import request from '@/utils/request'

export function add(data) {
  return request({
    url: 'api/basCustomer/addOrSave',
    method: 'post',
    data
  })
}

export function del(ids) {
  return request({
    url: 'api /basCustomer/',
    method: 'delete',
    data: ids
  })
}

export function edit(data) {
  return request({
    url: 'api/basCustomer/addOrSave',
    method: 'post',
    data
  })
}

export function enableOrDisable(data) {
  const obj = {
    url: 'api/basCustomer/enableOrDisable',
    method: 'post',
    data
  }
  return request(obj)
}

export function getCustomerList(params) {
  const obj = {
    url: 'api/basCustomer',
    method: 'get',
    params
  }
  return request(obj)
}

export function searchCustomer(params) {
  const obj = {
    url: 'api/basCustomer',
    method: 'get',
    params
  }
  return request(obj)
}

export function get(params) {
  const obj = {
    url: 'api/basCustomer',
    method: 'get',
    params
  }
  return request(obj)
}

export function getBasCustomerList(params) {
  const obj = {
    url: 'api/dropDown/getBasCustomerList',
    method: 'get',
    params
  }
  return request(obj)
}

export function getSCustomerList(params) {
  const obj = {
    url: '/api/dropDown/fCustomerBindSCustomerList',
    method: 'get',
    params
  }
  return request(obj)
}

export function getBasCustomerGoodsList(params) {
  const obj = {
    url: '/api/basCustomer/basCustomerGoodsList',
    method: 'get',
    params
  }
  return request(obj)
}

export function addOrSaveBasCustomerGoods(data) {
  return request({
    url: '/api/basCustomer/addOrSaveBasCustomerGoods',
    method: 'post',
    data
  })
}

export function delOrSaveBasCustomerGoods(data) {
  return request({
    url: '/api/basCustomer/removeBasCustomerGoods',
    method: 'post',
    data
  })
}

export function batchRemoveCustomerGoods(data) {
  return request({
    url: '/api/basCustomer/batchRemoveCustomerGoods',
    method: 'post',
    data
  })
}

export function batchUpdateBasCustomerGoods(data) {
  return request({
    url: '/api/basCustomer/batchUpdateBasCustomerGoods',
    method: 'post',
    data
  })
}

export function getCustomerUnBindGoodsList(params) {
  return request({
    url: '/api/dropDown/customerUnBindGoodsList',
    method: 'get',
    params
  })
}
export function getsCustomerUnBindGoodsList(params) {
  return request({
    url: '/api/dropDown/sCustomerUnBindGoodsList',
    method: 'get',
    params
  })
}

export function getfCustomerUnBindGoodsList(params) {
  return request({
    url: '/api/dropDown/fCustomerUnBindGoodsList',
    method: 'get',
    params
  })
}

export function addOrSaveBasCustomerRelation(data) {
  return request({
    url: '/api/basCustomer/addOrSaveBasCustomerRelation',
    method: 'post',
    data
  })
}

export function copy(data) {
  return request({
    url: '/api/basCustomer/copy',
    method: 'post',
    data
  })
}

export function syncCustomerGoods(data) {
  return request({
    url: '/api/basCustomer/syncCustomerGoods',
    method: 'post',
    data
  })
}
export function syncSCustomerGoods(data) {
  return request({
    url: '/api/basCustomer/syncSCustomerGoods',
    method: 'post',
    data
  })
}

export function syncFCustomerGoodsToSCustomerGoods(data) {
  return request({
    url: '/api/basCustomer/syncFCustomerGoodsToSCustomerGoods',
    method: 'post',
    data
  })
}
export function syncSCustomerGoodsToCustomerGoods(data) {
  return request({
    url: '/api/basCustomer/syncSCustomerGoodsToCustomerGoods',
    method: 'post',
    data
  })
}

export function getBasCustomerCredit(data) {
  return request({
    url: '/api/basCustomerCredit',
    method: 'get',
    params: data
  })
}

export function passOrReject(data) {
  return request({
    url: '/api/basCustomerCredit/passOrReject',
    method: 'post',
    data
  })
}

export function updateBasCustomerGoods(data) {
  return request({
    url: '/api/basCustomer/updateBasCustomerGoods',
    method: 'post',
    data
  })
}

export function createSysUser(ids) {
  return request({
    url: 'api/basCustomer/createSysUser',
    method: 'post',
    data: ids
  })
}
export function batchUpdate(data) {
  return request({
    url: '/api/basCustomer/batchUpdate',
    method: 'post',
    data
  })
}

export default { get, add, edit, del, enableOrDisable, copy, syncCustomerGoods, syncSCustomerGoods, syncFCustomerGoodsToSCustomerGoods, syncSCustomerGoodsToCustomerGoods, createSysUser }
